home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
tclib20.zip
/
DOSHK.H
< prev
next >
Wrap
C/C++ Source or Header
|
1988-12-03
|
2KB
|
53 lines
/* TCHK 2.0 - Howard Kapustein's Turbo C library 12-3-88 */
/* Copyright (C) 1988, Howard Kapustein. All rights reserved. */
/* doshk.h - header file for DOSHK.C - DOS routines */
#ifndef DOSHK_HEADER
#define DOSHK_HEADER 1
#include <howard.h>
typedef struct BIOSParmBlock {
unsigned int BytesPerSector; /* bytes per sector */
byte SectorsPerAllocUnit; /* sectors per cluster */
unsigned int ReservedSectors; /* reserved sectors (for boot record) */
byte numberFATs; /* number of FAT copies */
unsigned int numberRootDirEntries; /* number of root directory entries */
unsigned int TotalSectors; /* total number of sectors */
byte MediaDescriptor; /* media desriptor byte */
unsigned int SectorsPerFAT; /* sectors per FAT */
};
typedef struct BootBlock {
byte JumpInstr[3];
byte OEMinfo[9];
struct BIOSParmBlock BPB;
unsigned int SectorsPerTrack; /* sectors per track */
unsigned int numberHeads; /* number of heads (sides) */
unsigned int numberHiddenSectors; /* number of hidden sectors */
};
/* function prototypes */
boolean getBPB(int drive, struct BIOSParmBlock *BPB); /* get BIOS Parameter Block (A=0, B=1,...) */
boolean getBootBlock(int drive, struct BootBlock *BB); /* get Boot Block */
int memory_strategy(boolean read, int *strategy); /* get/set mem alloc strategy */
boolean isAssignavail(void); /* is ASSIGN installed */
boolean isAppendavail(void); /* is APPEND installed */
boolean isVidclock(void); /* is VIDCLOCK.COM installed */
int isShareavail(void); /* is SHARE installed */
#ifndef DOSHK_DEFINES
#define doshour(h) ((h & 0xF800) >> 11)
#define dosmin(m) ((m & 0x07E0) >> 5)
#define dossec(s) (s & 0x001F)
#define todostime(h,m,s) (((h << 11) & 0xF800) | ((m << 5) & 0x07E0) | (s & 0x001F))
#define dosyear(y) ((y & 0xFE00) >> 9)
#define dosmonth(m) ((m & 0x01E0) >> 5)
#define dosday(d) (d & 0x001F)
#define todosdate(y,m,d) (((y << 9) & 0xFE00) | ((m << 5) & 0x01E0) | (d & 0x001F))
#define DOSHK_DEFINES 1
#endif
#endif /* DOSHK_HEADER */